<%@taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@page pageEncoding="UTF-8"%>
<%@include file="../WEB-INF/jspf/controlesessao.jspf"%>

<sql:query var="query" dataSource="jdbc/dbo_MicrosoftSQLServer">
    SELECT  * FROM Modulos
    where id_curso=?
    <sql:param value="${param.id_curso}"/>
</sql:query>

<c:choose>
    <c:when test="${!empty query.rows}">
            <table cellspacing="0" width="400px">  <thead>
                    <th>Módulo</th>
                </thead>
                <tfoot>
                    <tr>
                        <td colspan="1">
                            ${query.rowCount} registros encontrados
                        </td>
                    </tr>
                </tfoot>
                <c:forEach var="row" items="${query.rows}">
                    <tr><td><a href="fm_update_Modulos.jsp?token=${sessionScope.token}&chave=${row.id_modulo}">${row.desc_modulo}</a></td>
                    </tr></c:forEach>
                </table>               
    </c:when>
    <c:otherwise>
        <p style="font-size: 12pt; color: red">Nenhum módulo encontrado.</p>
    </c:otherwise>
</c:choose>